home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2006 May
/
PCWMAY06.iso
/
Software
/
Freeware
/
First Page 2006 3.00
/
fp2006-final-3.00-setup.exe
/
{app}
/
Iscripts
/
Forms Misc
/
encode-special-char.izs
< prev
next >
Wrap
Text File
|
2005-09-28
|
2KB
|
108 lines
<!NOWIZARD>
<!TITLE>Encode Special Characters
<!/TITLE>
<!DESCRIPTION>When submitting the form "GET" method, JavaScript can encode special characters with the escape() function.<!/DESCRIPTION>
<!CATEGORY>Forms<!/CATEGORY>
<!SCRIPT>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL ENCODE SPECIAL CHARACTERS:
1. Copy code into the HEAD section of document
2. Put last coding into the BODY section of document -->
<!-- STEP ONE: Add code into HEAD section of document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function processForm(form) {
var nickname = form.nickname.value;
var password = form.password.value;
nickname = escape(nickname);
password = escape(password);
window.location = window.location + "?nickname=" + nickname + "&password=" + password;
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Add code into BODY section of document -->
<BODY>
<center>
<form action="">
<tt><pre>
Nickname: <input type=text name=nickname value="" size=10>
Password: <input type=text name=password value="" size=10>
<input type=button value="Submit!" onClick="javascript:processForm(this.form);">
</pre></tt>
</form>
</center>
<!-- END OF SCRIPT -->
<!/SCRIPT>
<!PREVIEW>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL ENCODE SPECIAL CHARACTERS:
1. Copy code into the HEAD section of document
2. Put last coding into the BODY section of document -->
<!-- STEP ONE: Add code into HEAD section of document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function processForm(form) {
var nickname = form.nickname.value;
var password = form.password.value;
nickname = escape(nickname);
password = escape(password);
window.location = window.location + "?nickname=" + nickname + "&password=" + password;
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Add code into BODY section of document -->
<BODY>
<center>
<form action="">
<tt><pre>
Nickname: <input type=text name=nickname value="" size=10>
Password: <input type=text name=password value="" size=10>
<input type=button value="Submit!" onClick="javascript:processForm(this.form);">
</pre></tt>
</form>
</center>
<!-- END OF SCRIPT -->
<!/PREVIEW>
<!RELATED>NONE<!/RELATED>